package com.mayisoftware.mayioa.business.worktime.impl.dao;


import com.mayisoftware.mayioa.business.worktime.api.domain.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 计划上传记录查询
 */
@Mapper
public interface TmWorktimeMapper {

    /////////////////////////////更新上传记录表/////////////////////
    /**
     *
     * 查询过滤记录信息
     * */
    List<WrokTimeImportInfo> selectRecordList(WrokTimeImportInfo record);

    /**
     * 根据ID查询记录信息
     */
    List<WrokTimeImportInfo> selectRecordListById(@Param("importId") String recordId);

    /**
     * 查询需要解析的记录
     */
    List<WrokTimeImportInfo> selectRecordListNeedParse();

    /**
     *
     * 更新上传记录
     * */
    int updateInputRecord(WrokTimeImportInfo record);

    /**
     * 插入上传记录
     * */
   int insertImportOneRecord(WrokTimeImportInfo wtImportInfo);

    //////////////////////////////////////////////////////////////////////

    ///////////////////更新TM考勤记录两张表t_tm_summary和t_tm_flow表/////////

//    int isTmSummarysExist(TMWorkTimeSummary summary);
//    void deleteExistTmSummary(TMWorkTimeSummary summary);
//    int batchInsertTmSummarys(List<TMWorkTimeSummary> summarys);

//    int isTmFlowsExist(TMWrokTimeFlow flow);
//    void deleteExistTmFlow(TMWrokTimeFlow flow);
//    int batchInsertTmFlows(List<TMWrokTimeFlow> flows);
//    List<String> queryInitOption();
    //////////////////////////////////////////////////////////////////////

    int isTmMonthExist(TMWorktimeMonthInfo monthInfo);
    void deleteExistTmMonth(TMWorktimeMonthInfo monthInfo);
    int batchInsertTmMonths(List<TMWorktimeMonthInfo> monthInfos);

    int isTmFlowsExist(TMWrokTimeFlow tmFlow);
    void deleteExistTmFlows(TMWrokTimeFlow tmFlow);
    int batchInsertTmFlows(List<TMWrokTimeFlow> tmFlows);

    int isTmGooutFlowsExist(TMWorktimeGoOutFlow gooutFlow);
    void deleteExistTmGooutFlows(TMWorktimeGoOutFlow gooutFlow);
    int batchInsertTmGooutFlows(List<TMWorktimeGoOutFlow> gooutFlows);


    int isTmExtraFlowsExist(TMWorktimeExtraFlow extraFlow);
    void deleteExistTmExtraFlows(TMWorktimeExtraFlow extraFlow);
    int batchInsertTmExtraFlows(List<TMWorktimeExtraFlow> extraFlows);

    int isTmLeaveFlowsExist(TMWorktimeLeaveFlow leaveFlow);
    void deleteExistTmLeaveFlows(TMWorktimeLeaveFlow leaveFlow);
    int batchInsertTmLeaveFlows(List<TMWorktimeLeaveFlow> leaveFlows);

    int isTmDetailFlowsExist(TMWorktimeDetailFlow detailFlow);
    void deleteExistTmDetailFlows(TMWorktimeDetailFlow detailFlow);
    int batchInsertTmDetailFlows(List<TMWorktimeDetailFlow> detailFlows);


    void deleteDoubtRepairMonth(TMWrokTimeFlow flow);
    void deleteDoubtRepairNight(TMWrokTimeFlow flow);
    int batchInsertDoubtRepairMonth();
    int batchInsertDoubtRepairNight();
}
